package com.shakev.coupon.business.model;

import com.shakev.coupon.data.mysql.entity.TCategory;
import lombok.Data;

import java.util.List;

/**
 * @ClassName CategoryRes
 * @Description TODO
 * @Author 李伟松
 * @CreateDate 2019-06-05 下午 9:15
 * @UpdateDate 2019-06-05 下午 9:15
 * @Version 1.0
 */
@Data
public class CategoryRes {
    private String name; //类目名称

    private String pic; //图片地址

    private Integer id; //类目id

    private Integer sort; //排序

    private Integer pid; // 父id

    private Boolean status; //是否展示

    private List<CategoryRes> children; //二级目录

    public CategoryRes(TCategory cate){
        name = cate.getNewName();
        id = cate.getCid();
        pid = cate.getParentId();
        status = true;
        sort = cate.getSort();
        pic = cate.getPic();
    }
}
